package org.setu.dev;
import java.sql.SQLException;

import org.setu.framework.constant.SetuEnvConstant;
import org.setu.framework.jdbc.develop.util.CodeGenerator;
import org.setu.framework.jdbc.enums.DbDialect;
import org.setu.framework.jdbc.handler.BaseDbConnResolve;

import com.founder.gateway.system.bean.DbConnStructure;

public class CodeUtil {
	public static void main(String[] args) throws SQLException{
//		generateOracle("ORG_USER");
//		generateOracle("ORG_ORGANIZATION");
//		generate("api_entity");
//		generate("api_info");
//		generate("api_param");
//		generate("api_return_param");
//		generate("api_scheme");
//		generate("app_info");
//		generate("api_auth_app");
	}
	public static void generate(String tableName) throws SQLException{
		CodeGenerator codeGenerator=new CodeGenerator(
				"F:\\founder-gateway",true
				,"47.93.118.224","3306","root","Founder123"
				,DbConnStructure.DC$GATEWAY, DbConnStructure.fz_api,DbConnStructure.class,DbDialect.MySQLDialect,BaseDbConnResolve.class,SetuEnvConstant.SETU_CREATOR);
		codeGenerator.init(false, "com.founder.gateway.orm",tableName, null,true);
	    codeGenerator.check();
		codeGenerator.printPara();
		codeGenerator.createDescribe();
		codeGenerator.createPo();
	}
	private static void generateOracle(String tableName) throws SQLException{
		CodeGenerator codeGenerator=new CodeGenerator(
				"F:\\founder-gateway",false
				,"47.93.118.224","1521","manager","jwzh#123"
				,"DC$JWZH", "ORCL",DbConnStructure.class,DbDialect.OrcleDialect, BaseDbConnResolve.class,SetuEnvConstant.SETU_CREATOR);
		codeGenerator.init(false, "com.founder.gateway.oauth.orm",tableName, null,false);
		codeGenerator.printPara();
		codeGenerator.createPo();
	}
}